﻿using System;

namespace LB.Common
{
    public static class Extentions
    {
        public static void Try<T>(this object o, Action action, Action<T> onError) where T : Exception
        {
            try
            {
                action.Invoke();
            }
            catch (T e)
            {
                onError(e);
            }
        }
    }
}
